//1:输出1-10000以内所有的质数并统计个数
package ZUOYE0424;

public class Task1 {

	public static void main(String[] args) {
		boolean q = true;
		int c = 0;
		for (int a = 2; a <= 10000; a++) {
			for (int b = 2; b * b <= a; b++) {
				if (a % b == 0) {
					q = false;
				}
			}
			if (q == true) {
				System.out.println(a);
				c++;
			}
			q = true;
		}
		System.out.println("质数共有" + c + "个");
	}
}
